import pandas as pd
from matplotlib import pyplot as plt
data = pd.read_excel('data.xlsx')
data = data[data['星级']<=5]
data_count = data['星级'].value_counts()

# plt.ylim
print(data_count)
plt.figure(figsize=(6,4))
plt.bar(data_count.index,data_count.values)
for a,b in zip(data_count.index,data_count.values):
    plt.text(a,b,'%.0f'%b,ha='center',va='bottom',fontsize=10)
plt.show()